package com.moli.iov.handle.alarm.enums;

/**
 * <p>
 *  在线离线状态
 * </p>
 *
 * @author: zql
 * @Date: 2019/2/25 13:28
 */
public enum OnOffStatusEnum {

    /**
     * 在线
     */
    ON(true, "在线"),

    /**
     * 离线
     */
    OFF_LINE(false, "离线");

    private boolean flag;

    private String msg;

    OnOffStatusEnum(boolean flag, String msg){
        this.flag = flag;
        this.msg = msg;
    }

    public static String getMsg(boolean flag){
        for(OnOffStatusEnum e : OnOffStatusEnum.values()){
            if(e.flag == flag){
                return e.msg;
            }
        }
        return "";
    }

    public boolean getFlag() {
        return flag;
    }


    public String getMsg() {
        return msg;
    }
}
